package com.example.leaderapplication.RetrufitHelp;

import com.example.leaderapplication.Bean.AddShiftsInfoRequsetBean;
import com.example.leaderapplication.Bean.AddShiftsInfoResultBean;
import com.example.leaderapplication.Bean.DeleteShiftsInfoRequsetBean;
import com.example.leaderapplication.Bean.DeleteShiftsInfoResultBean;
import com.example.leaderapplication.Bean.FindShiftsDetailInfoRequestBean;
import com.example.leaderapplication.Bean.FindShiftsDetailInfoResultBean;
import com.example.leaderapplication.Bean.FindShiftsListRequsetBean;
import com.example.leaderapplication.Bean.FindShiftsListResultBean;
import com.example.leaderapplication.Bean.FindShipListResultBean;
import com.example.leaderapplication.Bean.FindShipRouteListRequestBean;
import com.example.leaderapplication.Bean.FindShipRouteListResultBean;
import com.example.leaderapplication.Bean.IpResult;
import com.example.leaderapplication.Bean.UpdateShiftsInfoRequestBean;
import com.example.leaderapplication.Bean.UpdateShiftsInfoResultBean;
import com.example.leaderapplication.Bean.findDocumentCatagoryAdvertisementListRequestBean;
import com.example.leaderapplication.Bean.findDocumentCatagoryAdvertisementListResultBean;
import com.example.leaderapplication.Bean.findDocumentCatagoryContentListResultBean;
import com.example.leaderapplication.Bean.loginByLeaderRequestBean;
import com.example.leaderapplication.Bean.loginByLeaderResultBean;
import com.example.leaderapplication.Bean.updateUserPassWordRequestBean;
import com.example.leaderapplication.Bean.updateUserPassWordResultBean;

import java.util.Map;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by Ｔａｍｉｃ on 2016-07-08.
 * {@link # https://github.com/NeglectedByBoss/RetrofitClient}
 */
public interface BaseApiService {

//    public static final String Base_URL = "http://ip.taobao.com/";

    /**
     * 普通写法
     */
    @GET("service/getIpInfo.php")
    Observable<BaseResponse<IpResult>> getData(@Query("ip") String ip);


    @GET("{url}")
    Observable<BaseResponse<Object>> executeGet(
            @Path("url") String url,
            @QueryMap Map<String, String> maps
    );


    @POST("{url}")
    Observable<ResponseBody> executePost(
            @Path("url") String url,
            //  @Header("") String authorization,
            @QueryMap Map<String, String> maps);

    @POST("{url}")
    Observable<ResponseBody> json(
            @Path("url") String url,
            @Body RequestBody jsonStr);

    @Multipart
    @POST("{url}")
    Observable<ResponseBody> upLoadFile(
            @Path("url") String url,
            @Part("image\"; filename=\"image.jpg") RequestBody requestBody);

    @POST("{url}")
    Call<ResponseBody> uploadFiles(
            @Path("url") String url,
            @Path("headers") Map<String, String> headers,
            @Part("filename") String description,
            @PartMap() Map<String, RequestBody> maps);

    @Streaming
    @GET
    Observable<ResponseBody> downloadFile(@Url String fileUrl);

    //领导app  登入获取验证码
    @GET("developerUserLoginAction/getVerificationCode")
    Observable<ResponseBody> getVerificationCode();

    //领导app  登入接口
    @POST("developerUserLoginAction/loginByLeader")
    Observable<loginByLeaderResultBean> loginByLeader(@Body loginByLeaderRequestBean jjhLoginBean);

    //领导app 轮播图接口
    @POST("miniAppAction/findDocumentCatagoryAdvertisementList")
    Observable<findDocumentCatagoryAdvertisementListResultBean> findDocumentCatagoryAdvertisementList(@Body findDocumentCatagoryAdvertisementListRequestBean jjhLoginBean);

    //领导app 广告接口
    @POST("miniAppAction/findDocumentCatagoryContentList")
    Observable<findDocumentCatagoryContentListResultBean> findDocumentCatagoryContentList();

    //领导app 修改密码
    @POST("userManagerAction/updateUserPassWord")
    Observable<updateUserPassWordResultBean> updateUserPassWord(@Body updateUserPassWordRequestBean requestBean);

    //领导app 查询航线班次表接口
    @POST("shiftsAction/findShiftsList")
    Observable<FindShiftsListResultBean> findShiftsList(@Body FindShiftsListRequsetBean findShiftsListRequsetBean);

    //领导app 获取航线信息
    @POST("shiftsAction/findShipRouteList")
    Observable<FindShipRouteListResultBean> findShipRouteList(@Body FindShipRouteListRequestBean findShiftsListRequsetBean);

    //领导app 获取游船信息
    @POST("shiftsAction/findShipList")
    Observable<FindShipListResultBean> findShipList(@Body FindShipRouteListRequestBean findShiftsListRequsetBean);

    //领导app 添加航线班次表接口
    @POST("shiftsAction/addShiftsInfo")
    Observable<AddShiftsInfoResultBean> addShiftsInfo(@Body AddShiftsInfoRequsetBean findShiftsListRequsetBean);

    //领导app 删除航线班次表接口
    @POST("shiftsAction/deleteShiftsInfo")
    Observable<DeleteShiftsInfoResultBean> deleteShiftsInfo(@Body DeleteShiftsInfoRequsetBean findShiftsListRequsetBean);

    //领导app 航线班次表详情接口
    @POST("shiftsAction/findShiftsDetailInfo")
    Observable<FindShiftsDetailInfoResultBean> findShiftsDetailInfo(@Body FindShiftsDetailInfoRequestBean findShiftsListRequsetBean);

    //领导app 修改航线班次表接口
    @POST("shiftsAction/updateShiftsInfo")
    Observable<UpdateShiftsInfoResultBean> updateShiftsInfo(@Body UpdateShiftsInfoRequestBean findShiftsListRequsetBean);

}
